<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/11/30
 * Time: 16:20
 */
namespace app\common\helper;

class tpl_helper
{
    /**
     * 取得详情模板id
     * @param int $company_id
     * @param int $open_card_id
     * @return int
     */
    public static function get_detail_tpl($company_id = 0, $open_card_id = 0)
    {
        $tpl_info = self::get_selected_tpl_info($company_id, $open_card_id);
        if (!$tpl_info) {
            return 1;
        }

        return $tpl_info['detail_tpl'];
    }

    /**
     * 取得模板信息
     * @param int $company_id
     * @param int $open_card_id
     * @return array
     */
    public static function get_selected_tpl_info($company_id = 0, $open_card_id = 0)
    {
        if (!$open_card_id) {

            $open_card_id = open_card_helper::get_open_card_id();
        }
        if (!$company_id) {
            $company_id = company_helper::get_company_id();
        }

        return _uri('tpl', array('company_id'=>$company_id, 'open_card_id'=>$open_card_id));
    }
}